package com.test;

/**
 * @author lufeng
 * @date 2021/9/5 16:49
 */
public class test3 {
    //定义一个方法，用于比较两个数组的内容是否相同

    public static void main(String[] args) {
        int[] arr1 = {68, 27, 95, 88, 171, 996, 51, 210};
        int[] arr2 = {68, 27, 95, 88, 171, 986, 51, 210};
        boolean a = arr(arr1,arr2);
        System.out.println(a);
    }

    public static boolean arr(int[] arr1, int[] arr2) {
        if (arr1.length != arr2.length) {
            System.out.println("两个数组内容不同");
           return  false;

        }
        for (int i = 0 ;i< arr1.length-1;i++){
            if (arr1[i]!=arr2[i]){
              return false;
            }
        }
        return true;
    }
}
